<template>
	<view class="content">
		<view class="anonymous-phone">{{ anonymousPhone }}</view>
		<embed class="quick-login-button" tag="quick-login-button" @loginsuccess="onLoginSuccess"></embed>
	</view>
</template>

<script>
	import { getQuickLoginAnonymousPhone } from '@/uni_modules/hw-quick-login-button'
	export default {
		data() {
			return {
				anonymousPhone: ''
			}
		},
		async onLoad() {
			this.anonymousPhone = await getQuickLoginAnonymousPhone()
		},
		methods: {
			onLoginSuccess(e) {
				uni.showModal({
					content: JSON.stringify(e)
				})
			}
		}
	}
</script>

<style>
	.content {
		padding-top: 100px;
		text-align: center;
	}
	.quick-login-button {
		margin-top: 50px;
		width: 300px;
		height: 50px;
	}
</style>
